-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace usage of try! with ? #331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, does what it says.
src/lib.rs
Outdated
.ok_or(()) | ||
.or_else(|()| f(self)) | ||
.or_else(|()| io_error("URL has no port number"))) | ||
.or_else(|()| io_error("URL has no port number"))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please re-align these lines. (untry
should have shown a warning about multi-line replacement.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed; is there a specific set of rustfmt settings that should be used? I tried to use it originally but it realigned a ton of other stuff so I left any sort of alignment issues alone. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustfmt does a lot more things than just replacing try!
. If we’re gonna go down that road I’d prefer to go all the way and enforce rustfmt-like style in CI. But that seems more disruptive than I wanted to get into right now, so I recommended untry instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see; untry gave me some warning about beign deprecated in favor of rustfmt; anyways, doesn't matter, fixed now. Thanks!
Fixes #330 ? or do not. There is no try.
Great, thanks! @bors-servo r+ |
📌 Commit b4d7400 has been approved by |
Replace usage of try! with ? Replaces all uses of `try!` with the `?` operator. Fixes #330 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/331) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Replaces all uses of
try!
with the?
operator.Fixes #330
This change is